addEvent("cmta_antybot",true)
addEventHandler("cmta_antybot",resourceRoot,function()
	exports["cmta-db"]:dbSet("INSERT INTO cmta_logs_antybot SET nick=?, uid=?",getPlayerName(client):gsub("#%x%x%x%x%x%x",""),getElementData(client,"player:data").uid)
    local r=exports["cmta-db"]:dbGet("select * from cmta_users WHERE id=?", getElementData(client,"player:data").uid)
    if r[1]["kicksbot"] >= 2 then
        exports["cmta-db"]:dbSet("UPDATE cmta_users SET kicksbot=0 WHERE id=?",getElementData(client,"player:data").uid)
        exports["cmta-db"]:dbSet("INSERT INTO cmta_bans (nick,serial,uid,type,reason,time,banned_by) VALUES (?,?,?,?,?,NOW() + INTERVAL ? DAY,?)", getPlayerName(client),getPlayerSerial(client),getElementData(client, "player:data").uid,"ban","AntyBot", 3, "System")
        kickPlayer(client,"AntyBot")
    else
        exports["cmta-db"]:dbSet("UPDATE cmta_users SET kicksbot=kicksbot+1 WHERE id=?",getElementData(client,"player:data").uid)
    end
    kickPlayer(client,"Nie przepisałeś kodu.")
end)